package form.core
{
	import flash.display.DisplayObject;
	
	import form.ui.ApplicationContainer;
	
	public class PopUpManager
	{
		private static var application:ApplicationContainer = ApplicationContainer.application;
		
		public static function addPopUp(displayObject:DisplayObject, center:Boolean, blur:Boolean, mode:Boolean):DisplayObject
		{
			if(center)
			{
				displayObject.x = application.root.stage.stageWidth/2 - displayObject.width/2;
				displayObject.y = application.root.stage.stageHeight/2 - displayObject.height/2;
			}
			return application.addOverlay(displayObject, blur, mode);
		}
		
		public static function removePopup(displayObject:DisplayObject):void
		{
			application.removeOverlay(displayObject);
		}
		
		public static function clearPopup():void
		{
			application.clearOverlay();
		}

	}
}